package com.ahm.server.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author anhaimeng
 * @title: MyConfig
 * @projectName yeb001
 * @description: TODO
 * @date 2021/9/2217:30
 */
/*功能描述
 * @author ahm
 */
@Configuration
@MapperScan("com.ahm.server.mapper")
public class MyBatisPlusConfig {


    /**
    　　* @description: 配置分页插件
    　　* @author anhaimeng
    　　* @date 2021/9/23 14:21
    　　*/
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }



//    @Bean
//    public MybatisPlusInterceptor mybatisPlusInterceptor() {
//        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
//        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
//        return interceptor;
//    }
}
